StringScanner.ReplaceStringI Function

Syntax

Result_Flag as L = ReplaceStringI as l(search as c,replace as c)

Arguments

Result_Flag

True indicates that a replacement was made.

search

The text to find in the buffer. Case insensitive.

replace

The replacement text.

Description

Search for text after current offset, and replace it if found.

Discussion

The <StringScanner>.ReplaceString() function replaces the first instance of the Search argument (case insensitive) with the Replace argument. The offset is positioned immediately after Replace_Text.

Example

dim scanner as P
dim txt as C
txt = <<%text%
This is wonderful text
written by a great writer
%text%
scanner = stringscanner.create(txt)
? scanner.ReplaceStringI("wonderful","magnificent")
= .T.
? scanner.GetToOffset()
= "This is magnificent"
? scanner.GetRemainder()
=prose written
by a technical writer of note.

See Also